﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy1_3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnCalculate_Click(object sender, EventArgs e)
        {
            double x = Convert.ToDouble(txtX.Text);
            double y = Convert.ToDouble(txtY.Text);
            double r = Convert.ToDouble(txtR.Text);

            // 创建Circle对象并赋值
            Circle circle = new Circle();
            circle.SetValue(x, y, r);

            // 计算并显示结果
            txtArea.Text = circle.GetArea().ToString();
            txtPerimeter.Text = circle.GetPerimeter().ToString();
            txtDistance.Text = circle.GetDistance().ToString();
        }
    }
}
